﻿#region Legal notice
/*
 * This file is part of EPPLib.
 * Copyright 2010, 2011 
 * Gianluca Esposito (info@gianlucaesposito.it)
 * ----------------------------------------------------------------------------
 * EPPLib is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 * 
 * EPPLib is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with Nome-Programma; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
#endregion

#region Using directives
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using System.Xml.Serialization;
using System.Text;
using System.Xml;
using System.Xml.Schema;
#endregion

namespace EPPLib.Objects
{
    [Serializable]
    public class PostalInfoObject : BaseObject
    {
        #region Members
        private string _type;
        private string _name;
        private string _organization;
        private AddressInfoObject _address;
        #endregion

        #region Properties
        [XmlAttribute(AttributeName = "type")]
        public string Type { get { return _type; } set { _type = value; } }

        [XmlElement(ElementName = "name")]
        public string Name { get { return _name; } set { _name = value; } }

        [XmlElement(ElementName = "org")]
        public string Organization { get { return _organization; } set { _organization = value; } }

        [XmlElement(ElementName = "addr")]
        public AddressInfoObject Address { get { return _address; } set { _address = value; } }

        [XmlIgnoreAttribute()]
        public bool OrganizationSpecified { get { return !string.IsNullOrEmpty(_organization); } }
        #endregion

        #region Constructor(s)
        public PostalInfoObject()
        {
            _type = "loc";
            _name = string.Empty;
            _organization = string.Empty;
            _address = new AddressInfoObject();
        }
        #endregion
    }
}